package com.gxa.token.controller;

import com.gxa.token.service.TokenRefreshService;
import dto.ResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import param.AuthParam;

import javax.annotation.Resource;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/token")
@Api(tags = "刷新token")
public class TokenRefreshController {

    @Resource
    private TokenRefreshService tokenRefreshService;

    @ApiOperation(value = "刷新token接口")
    @PostMapping("/refreshToken")
    @ApiImplicitParams({
            @ApiImplicitParam(name="token",value="token",required = true),
    })
    public ResultDTO refreshToken(@RequestBody AuthParam authParam){
        return tokenRefreshService.refreshToken(authParam);
    }
}
